<?php
/**
*作用: 个人中心
*说明: 
*版权: CPC
*作者: Red	QQ:316765128
*时间: 2011/10/12
**/
include_once './include/init.inc.php';

include_once './include/cpc_qplus.cls.php';
include_once './include/model.cls.php';
$model = new model_sql();

$user_id = getCookie('user_id');
$user_id = '5';


if(empty($s)){
	$s = 'home';
}
$arr = array('home');
if(!in_array($s,$arr)){
	header("Location: ./\n");
	exit();
}

if($s == 'home'){
	empty($k)?$k = '1':'';					//条件分类
	if($k>10) exit('error!');
	$smarty->assign('k',$k);
	$term = array();
	empty($city)?'':$term['city']=$city;	//相同城市
	empty($kind)?'':$term['kind']=$kind;	//养同品种
	empty($boy)?'':$term['boy']=$boy;		//男
	empty($girl)?'':$term['girl']=$girl;	//女
	empty($get)?'':$term['get']=$get;		//想养

	switch($k){
		case '1':
			$user_id_list = $model->searchNewLoginUser($term);		//最新登陆
			break;
		case '2':
			$user_id_list = $model->searchTopLikeUser($term);		//最高人气
			break;
		case '3':
			$user_id_list = $model->searchNewLikeUser($term);		//最新喜欢
			break;
		case '4':
			$user_id_list = $model->searchBoyGirlUser($term);		//型男靓女
			break;
		case '5':
			$user_id_list = $model->searchStarMemberUser($term);	//明星会员
			break;
		case '6':
			$user_id_list = $model->searchMedalMasterUser($term);	//勋章达人
			break;
		default:
			$user_id_list = array();
	}
	$user_list = $model->getUserPetList($user_id_list);
	$smarty->assign('user_list',$user_list);
/*////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
}

fheader('friend/'.$s.'.css');
$smarty->display('friend/'.$s.'.dwt');
ffooter();

?>